<!DOCTYPE html>
<html lang="zh-en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>九九乘法表</title>
    <style>
        body {
            font-family: 'Courier New', Courier, monospace;
            font-size: 30px;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
            background-color: #f5f5f5; /* 添加背景色，便于观察效果 */
        }
        table {
            border-collapse: separate;  /* 设置为 separate，使单元格之间不合并 */
            border-spacing: 5px;         /* 设置单元格之间的间距 */
            width: auto;
        }
        td {
            width: 80px;  /* 保持单元格的宽度 */
            height: 60px; /* 调整单元格的高度，设置为 60px */
            text-align: center;
            border: 2px solid blue; /* 设置边框为蓝色 */
            transition: background-color 0.3s, color 0.3s;
            padding: 5px;  /* 设置单元格内部的间距 */
        }
        td:hover {
            background-color: blue; /* 鼠标悬停时，背景色为蓝色 */
            color: white; /* 鼠标悬停时，字体颜色为白色 */
        }
    </style>
</head>
<body>
    <table id="multiplicationTable"></table>
    <script>
        function generateMultiplicationTable() {
            const table = document.getElementById('multiplicationTable');
            for (let i = 1; i <= 9; i++) {
                const row = document.createElement('tr');
                for (let j = 1; j <= i; j++) {
                    const cell = document.createElement('td');
                    cell.textContent = `${j}x${i}=${i * j}`;
                    row.appendChild(cell);
                }
                table.appendChild(row);
            }
        }

        generateMultiplicationTable();
    </script>
</body>
</html>
